package com.itruth.entity;

import java.io.Serializable;
import java.sql.Timestamp;

import com.itruth.util.CommonUtil;

public class ShareEntity implements Serializable {
	
	private static final long serialVersionUID = 6493665714623096589L;
	
	/**
	 * 存放在数据库中分享数据的索引id
	 */
	private int id;
	
	private String author;
	
	private String content;
	
	private Timestamp shareTime;
	
	public ShareEntity() {
		
	}
	
	public ShareEntity(String userName, String content, Timestamp addTime) {
		super();
		this.author = userName;
		this.content = content;
		this.shareTime = addTime;
	}

	public void setId(int shareId) {
		this.id = shareId;
	}
	
	public int getId() {
		return id;
	}
	
	public String getAuthor() {
		return author;
	}

	public void setAuthor(String userName) {
		this.author = userName;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * 返回addTime原生类型数据
	 * @return
	 */
	public Timestamp obtainShareTime() {
		return shareTime;
	}
	
	/**
	 * 生成json格式数据时使用
	 * @return
	 */
	public String getShareTime() {
		return CommonUtil.getStringDate(shareTime);
	}
	
	public void setShareTime(Timestamp addTime) {
		this.shareTime = addTime;
	}

}
